package edu.unlv.cs.ladders.entities;

import edu.unlv.cs.ladders.entities.Event;
import java.lang.Long;
import java.util.List;

privileged aspect Event_Roo_Entity {
    
    public static long Event.countEvents() {
        return (Long) entityManager().createQuery("select count(o) from Event o").getSingleResult();
    }
    
    public static List<Event> Event.findAllEvents() {
        return entityManager().createQuery("select o from Event o").getResultList();
    }
    
    public static Event Event.findEvent(Long id) {
        if (id == null) return null;
        return entityManager().find(Event.class, id);
    }
    
    public static List<Event> Event.findEventEntries(int firstResult, int maxResults) {
        return entityManager().createQuery("select o from Event o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
    }
    
}
